package com.bjbn.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bjbn.entity.Position;
import com.bjbn.mapper.PositionMapper;
import com.bjbn.service.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PositionServiceImpl  implements PositionService {

    @Autowired
    private PositionMapper positionMapper;

    @Override
    public Position getPositionByNameAndOrganization(String name, String organization) {
        QueryWrapper<Position> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("f_full_name",name);
        queryWrapper.eq("f_organize_id",organization);
       return positionMapper.selectOne(queryWrapper) ;
    }

    @Override
    public void insertPosition(Position position) {
        positionMapper.insert(position);
    }
}
